<script setup>
import refsC from '@/views/test/components/refs-c'
import { ref } from 'vue';

const refs = ref([])

const setRefs = (el, i) => {
  refs.value[i] = el

  console.log(refs.value)
}

const changeValue = (i) => {
  refs.value[i].returnDate()
}
</script>

<template>
  <div class="">
    <div v-for="(item, index) in 10" :key="item" class="list">
      <refsC :ref="(el) => setRefs(el, index)"></refsC> <span @click="changeValue(index)">变更值</span>
    </div>

  </div>
</template>

<style lang="scss" scoped>
.list{
  margin: 12px;
}
</style>
